def divingBoard(shorter, longer, k):  
    # 初始化结果列表  
    possible_lengths = []  
      
    # 遍历所有可能的组合  
    for i in range(k + 1):  
        length = i * longer + (k - i) * shorter  
        possible_lengths.append(length)  
      
    # 如果 shorter 和 longer 相等，那么结果中会有重复的长度，需要进行去重  
    if shorter == longer:  
        possible_lengths = list(set(possible_lengths))  
      
    # 对结果列表进行排序  
    possible_lengths.sort()  
      
    return possible_lengths  
  
# 示例测试  
shorter = 1  
longer = 2  
k = 3  
print(divingBoard(shorter, longer, k)) 